/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.qihoo.gamecenter.sdk.support.f;

import android.content.Context;
import android.graphics.Color;
import com.qihoo.gamecenter.sdk.common.h.d;
import com.qihoo.gamecenter.sdk.common.h.d.a;
import com.qihoo.gamecenter.sdk.common.i.s;
import com.qihoo.gamecenter.sdk.support.g.a;
import java.util.Map;
import org.json.JSONArray;
import org.json.JSONObject;

public class b extends d {
    public b(Context paramContext, d.a parama) {
        super(paramContext, parama, false);
    }

    protected String a(Context paramContext, String[] paramArrayOfString) {
        String str1 = null;
        if (Boolean.parseBoolean(paramArrayOfString[1]))
            str1 = "landscape";
        else
            str1 = "portrait";
        String str2 = "http://ku.mgamer.cn/msdk/getexit" + "/package_name/" + paramContext.getPackageName()
                + "/app_key/" + s.r(paramContext) + "/imei/" + s.i(paramContext) + "/qid/" + paramArrayOfString[0]
                + "/screen_orientations/" + str1;
        return str2;
    }

    protected String a() {
        return null;
    }

    protected Map b(Context paramContext, String[] paramArrayOfString) {
        return null;
    }

    protected a b(JSONObject paramJSONObject) {
        if (paramJSONObject != null) {
            a locala = new a();
            a.a(locala, paramJSONObject.optInt("errno", -1));
            a.a(locala, paramJSONObject.optString("errmsg", ""));
            if (locala.a()) {
                JSONObject localJSONObject1 = paramJSONObject.optJSONObject("data");
                if (localJSONObject1 != null) {
                    a.b(locala, localJSONObject1.optString("window_type", "default"));
                    JSONObject localJSONObject2 = localJSONObject1.optJSONObject("window_content");
                    if (localJSONObject2 != null)
                        if (a.a(locala).equals("news")) {
                            a.c(locala, localJSONObject2.optString("window_pic", ""));
                            a.d(locala, localJSONObject2.optString("bbs_url", ""));
                            JSONArray localJSONArray = localJSONObject2.optJSONArray("news");
                            if (localJSONArray != null) {
                                a.a(locala, new b[localJSONArray.length()]);
                                try {
                                    for (int i = 0; i < localJSONArray.length(); ++i) {
                                        a.b(locala)[i] = new b();
                                        JSONObject localJSONObject3 = localJSONArray.getJSONObject(i);
                                        b.a(a.b(locala)[i], localJSONObject3.optString("title"));
                                        b.a(a.b(locala)[i], Color.parseColor(localJSONObject3.optString("color")));
                                        b.b(a.b(locala)[i], localJSONObject3.optString("url"));
                                    }
                                } catch (Exception localException) {
                                    a.c("GCGetQuitAdsTask", new Object[] { localException.toString() });
                                }
                            }
                        }
                        else if (a.a(locala).equals("pic")) {
                            a.c(locala, localJSONObject2.optString("window_pic", ""));
                            a.d(locala, localJSONObject2.optString("bbs_url", ""));
                            a.e(locala, localJSONObject2.optString("pic_direct", "http://u.360.cn"));
                        }
                }
            }
            return locala;
        }
        return null;
    }

    public class b {
        private String b;
        private int c;
        private String d;

        public String a() {
            return this.b;
        }

        public int b() {
            return this.c;
        }

        public String c() {
            return this.d;
        }
    }

    public class a {
        private int b;
        private String c;
        private String d = "default";
        private String e;
        private String f;
        private b.b[] g;
        private String h;

        public boolean a() {
            return (this.b == 0);
        }

        public String b() {
            return this.e;
        }

        public String c() {
            return this.f;
        }

        public String d() {
            return this.h;
        }

        public String e() {
            return this.d;
        }

        public b.b[] f() {
            return this.g;
        }
    }
}